﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddEdit.aspx.cs" Inherits="CardLogistics.Web.MainPage.PutInCard.PutInCard.AddEdit" %>

<%@ Register Src="../../../Controls/WebUserControl_Nav.ascx" TagName="WebUserControl_Nav"
    TagPrefix="uc1" %>
<%@ Register Assembly="MattBerseth.WebControls.AJAX" Namespace="MattBerseth.WebControls.AJAX.Progress"
    TagPrefix="mb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>半成品/成品卡入库-编辑</title>
    <link href="../../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/selPage.css" rel="stylesheet" type="text/css" />
    <script src="../../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../../../js/valReq.js" type="text/javascript"></script>
    <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../../js/jquery.tipswindow.2.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        function valReq(issubmit) {
            var altStr = valid_isempty('PUTINNO', '入库单号');
            //必须为字母或者数字
            altStr += valid_isnoCh('PUTINNO', '入库单号');
            altStr += valid_isempty('OutStorageNo', '出库单号');
            altStr += valid_isempty('PUTINDATE', '入库日期');
            altStr += valid_isempty('CREATEUSER', '制卡人');
            altStr += valid_isempty('CREATEDATE', '制卡日期');
            if (altStr != "") {
                alert(altStr);
                return false;
            }
            else {
                if (issubmit == 1) {
                    if (confirm("提交后该信息进入待审批状态不可编辑,确认提交吗?") == true) {
                        return true;
                    }
                    else
                        return false;
                }
                else
                    return true;
            }
        }
        //验证是否选择了待上传文件
        function LoadFile() {
            var altStr = valid_isempty('OutStorageNo', '出库单号');
            if (altStr != "") {
                //导入文件前验证出库单号是否选择
                alert("请先选择出库单号！");
                return false;
            }
            var fstr = document.getElementById("FileUpload1").value;
            if (fstr == "") {
                alert("请选择您要上传的文件！");
                return false;
            }
            return true;
        }
            // 删除半成品入库信息
        function DelPutInCard(obj) {
            var cardId = obj.getAttribute("tsCardId");
            return confirm("确认要删除卡面号为【" + cardId + "】的数据吗？");

            }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {    //选择需求单
            $("#OutStorageNo").click(function () {
                $.tipsWindow({
                    ___title: "选择需求单",
                    ___content: "iframe:../../SelectPage/SelCardOutStorage.aspx?type=putin",
                    ___width: "1000",
                    ___height: "500",
                    ___drag: "___boxTitle",
                    ___showbg: true
                });
            });
        })
        
    </script>
    <style type="text/css">
        input.FormText
        {
            background-color: #ffffff;
            color: #000000;
            border: 1px solid;
        }
    </style>
    <style type="text/css">
        .delImg
        {
            width: 16px;
            height: 16px;
            margin-bottom: -3px;
        }
    </style>
</head>
<body>
    <form id="frmFather" runat="server">
    <uc1:WebUserControl_Nav ID="WebUserControl_Nav1" runat="server" />
    <%=TitleName %>
    <input type="hidden" id="hf_ConId" name="hf_ConId" runat="server" />
    <table class="theForm" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="titleTxtM">
                入库单号：
            </td>
            <td class="contentTxtM">
                <input id="PUTINNO" runat="server" type="text" class="dfinputNoEmp" maxlength="15" />
            </td>
            <td class="titleTxtM">
                出库单号：
            </td>
            <td class="contentTxtM">
                <input id="OutStorageNo" readonly="readonly" runat="server" type="text" class="dfinputImgM"
                    maxlength="25" />
                <asp:HiddenField ID="hf_OutStorageId" runat="server" />
            </td>
            <td class="titleTxtM">
                制卡人：
            </td>
            <td class="contentTxtM">
                <input id="CREATEUSER" runat="server" type="text" class="dfinputNoEmp" maxlength="25" />
            </td>
        </tr>
        <tr>
            <td class="titleTxtM">
                制卡日期：
            </td>
            <td class="contentTxtM">
                <input id="CREATEDATE" runat="server" type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
            </td>
            <td class="titleTxtM">
                入库日期：
            </td>
            <td class="contentTxtM">
                <input id="PUTINDATE" runat="server" type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
            </td>
            <td class="titleTxtM">
                卡类型
            </td>
            <td class="contentTxtM">
                <input id="txtCardType" runat="server" type="text" class="dfinput" readonly="readonly"/>
            </td>
        </tr>
        <tr>
            <td class="titleTxtM">
                备注：
            </td>
            <td class="contentTxtM" colspan="5">
                <input id="REMARK" runat="server" type="text" class="dfinput" style="width: 90%;"
                    maxlength="200" />
            </td>
        </tr>
        <tr>
            <td colspan="6" style="text-align: left; border: 1px;">
                <asp:FileUpload ID="FileUpload1" runat="server" CssClass="dfFile" Width="350px" />
                <asp:Button ID="btnImport" runat="server" Text="导入" CssClass="scbtn" OnClientClick="return LoadFile();"
                    OnClick="btnImport_Click" />
            </td>
        </tr>
        <tr id="tr_IC1" runat="server" visible="false">
            <td class="titleTxtM">
                版本号：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="CardVERSION" runat="server" Text="Label"></asp:Label>
            </td>
            <td class="titleTxtM">
                卡类型：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="CARDKIND" runat="server" Text="Label"></asp:Label>
            </td>
            <td class="titleTxtM">
                制卡批次号：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="BATCHID" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr id="tr_IC2" runat="server" visible="false">
            <td class="titleTxtM">
                初始卡号：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="CARDBEGINSSN" runat="server" Text="Label"></asp:Label>
            </td>
            <td class="titleTxtM">
                结束卡号：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="CARDENDSSN" runat="server" Text="Label"></asp:Label>
            </td>
            <td class="titleTxtM">
                记录总数：
            </td>
            <td class="contentTxtM">
                <asp:Label ID="RECNUM" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr id="tr_Details" runat="server" visible="false">
            <td colspan="6" style="padding: 2px;">
                <div style="overflow-y: auto; width: 100%; max-height: 300px;">
                    <asp:Repeater ID="rptDetailList" runat="Server">
                        <HeaderTemplate>
                            <table class="tabledetail" id="tbDetailList">
                                <thead>
                                    <tr>
                                        <th>
                                            序号
                                        </th>
                                        <th>
                                            发卡机编号
                                        </th>
                                        <th>
                                            操作员编号
                                        </th>
                                        <th>
                                            发卡日期
                                        </th>
                                        <th>
                                            有效期
                                        </th>
                                        <th>
                                            卡面号
                                        </th>
                                        <th>
                                            卡号
                                        </th>
                                        <th>
                                            CSN代码
                                        </th>
                                        <th>
                                            主卡标志
                                        </th>
                                        <th>
                                            子卡标志
                                        </th>
                                        <th>
                                            卡校验值
                                        </th>
                                        <th>
                                            卡成本(分)
                                        </th>
                                        <th>
                                            余额(分)
                                        </th>
                                        <th>
                                            卡启用标志
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td align="center">
                                    <%# Container.ItemIndex+1+(WebPageIndex*WebPageSize-10) %>
                                    <% if (isSubmit == "0")
                                       {%>
                                    <asp:ImageButton ID="imgBtn" ImageUrl="../../../images/del.png" CssClass="delImg"
                                        runat="server" tsCardId='<%#Eval("CardId").ToString().Trim() %>' Height="16px" Width="16px" OnClientClick='return DelPutInCard(this);'
                                        OnClick="Ibtn_Del_Click" CommandArgument='<%#Eval("CardId") %>' />
                                    <% }%>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%# Eval("DevId") %>' ID="lbl_DevId" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("OprId") %>' ID="lbl_OprId" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("IssDate") %>' ID="lbl_IssDate" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("ExpDate") %>' ID="lbl_ExpDate" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("CardId") %>' ID="lbl_CardId" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("CardSSN") %>' ID="lbl_CardSSN" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("CardCSN") %>' ID="lbl_CardCSN" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("CardType") %>' ID="lbl_CardType" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("ChildCardType") %>' ID="lbl_ChildCardType" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("CardMac") %>' ID="lbl_CardMac" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("FgvAmt") %>' ID="lbl_FgvAmt" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("InitAmt") %>' ID="lbl_InitAmt" runat="server"></asp:Label>
                                </td>
                                <td align="center">
                                    <asp:Label Text='<%#Eval("IniFlag") %>' ID="lbl_IniFlag" runat="server"></asp:Label>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </tbody></table>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
            </td>
        </tr>
        <tr class="btntr">
            <td colspan="6" align="center">
                <asp:Button ID="btn_Submit" CssClass="btn" runat="server" Text="保存并提交" OnClientClick="return valReq(1);"
                    OnClick="btn_Submit_Click" />
                <asp:Button ID="btn_Add" CssClass="btn" runat="server" Text="保存" OnClientClick="return valReq(0);"
                    OnClick="btn_Add_Click" />
                <input type="button" class="btn" value="返回" onclick="javascript:history.go(-1);" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
